
/**
 * Date:2019年9月4日下午3:01:21
 * Copyright (c) 2019, www.bwbroad.com All Rights Reserved.
 *
*/

package com.xue.common.lock;

/**
 * Description: TODO <br/>
 * Date: 2019年9月4日 下午3:01:21 <br/>
 * 
 * @author xuejianxin
 */
public interface DistributedLock {
	public static final long TIMEOUT_MILLIS = 30000;

	public static final int RETRY_TIMES = Integer.MAX_VALUE;

	public static final long SLEEP_MILLIS = 500;

	boolean lock(String key);

	boolean lock(String key, int retryTimes);

	boolean lock(String key, int retryTimes, long sleepMillis);

	boolean lock(String key, long expire);

	boolean lock(String key, long expire, int retryTimes);

	boolean lock(String key, long expire, int retryTimes, long sleepMillis);

	boolean releaseLock(String key);
}
